const express=require('express')
const path=require('path')
const app=express()
app.get('/user',(request,response)=>{
    const {userID}=request.query
    if(userID!=='001'){
        return response.send({
            code:000,
            msg:'查询失败',
            data:null
        })
    }
    response.send({
            code:101,
            msg:'查询成功',
            data:{
                name:'晓月',
                age:18,
                sex:'男'
            }
    })
})
app.get('/1',(request,response)=>{
    const filePath=path.resolve(__dirname,'index.html')
    response.sendFile(filePath)
})
app.listen(9000,()=>{
    console.log('服务器部署成功 地址为http://127.0.0.1:9000');
})